<?php 
include "session_control.php";
?>

<?php

  include "connect.php";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Aktueller Stand und Entwicklungen</title>

<style type="text/css">
.logout {
	position:absolute;
	top:300px;
	left:580px;
}

body{
	font-family: Helvetica, sans serif;
}
.text{
	text-align:center;
	font-size:large;
}
</style>

</head>

<body>

<div class = "text">Ihre bisherigen Ergebnisse</div>
<?php

$username = $_SESSION["username"];

$user_id = mysql_query ("SELECT user_id FROM user WHERE username = '$username'");

 

$i = 0;

while($array= mysql_fetch_assoc($exist_ids))
{
	$survey_id[$i] = $array["survey_id"];
	
for ($i = 0;$i <= sizeof(survey_id);$i++)
{
	//$titel = mysql_query("SELECT survey_name FROM surveys WHERE survey_id = '$survey_id[$i]'");
	echo $titel;
	
	if($survey_id)
	{
		$overallresult = mysql_query("SELECT timestamp, points, level FROM results WHERE user_id = '$user_idNew' AND survey_id = '$survey_id[$i]' ORDER BY timestamp desc");
		
		?>
		<table border = '1'>

			<tr>
				<td>Datum</td>
				<td>Punkte</td>
				<td>Status</td>
			</tr>

		<?php	
		while($row = mysql_fetch_object($overallresult))
		{
			echo "</tr>";
			echo "<td>$row->timestamp</td>";
			echo "<td>$row->points</td>";
			echo "<td>$row->level</td>";
			echo "</tr>";
		}
	}
	$i++;
}
}


?>
</table>
<form action="logout.php" method="post">

<input class="logout" type="submit" value="Logout">
</form>

</body>

</html>

